package com.woniu.conversion;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.data.WriteCellData;

public class PersonExcelStatusConversion implements Converter<Integer> {
    @Override
    public Class<?> supportJavaTypeKey() {
        return Integer.class;
    }


    public WriteCellData<?> convertToExcelData(Integer status) throws Exception {
        if (status == null) {
            return new WriteCellData("");
        }
        // 将数字转换为汉字
        if (status == 1) {
            return new WriteCellData("在线");
        } else if (status == 0) {
            return new WriteCellData("离职");
        }
        return new WriteCellData("未知");
    }
}
